<!-- 排序 -->

<template>
	<view
		class="flex align-center"
		@click="change"
	>
		<text class='searchResultsMall_fd1_0_c0_c0_c1_c0'>{{name}}</text>
		<view class='flex flex-direction flex-wrap align-center'>
			<image
				v-if="SORT_TYPE.ASC == value"
				class='searchResultsMall_fd1_0_c0_c0_c1_c1_c0'
				mode="aspectFit"
				:src='STATIC_URL+"710.png"'
			></image>
			<image
				v-else
				class='searchResultsMall_fd1_0_c0_c0_c1_c1_c0'
				mode="aspectFit"
				:src='STATIC_URL+"719.png"'
			></image>
			<image
				v-if="SORT_TYPE.DESC == value"
				class='searchResultsMall_fd1_0_c0_c0_c1_c1_c1'
				mode="aspectFit"
				:src='STATIC_URL+"720.png"'
			></image>
			<image
				v-else
				class='searchResultsMall_fd1_0_c0_c0_c1_c1_c1'
				mode="aspectFit"
				:src='STATIC_URL+"711.png"'
			></image>
		</view>
	</view>
</template>

<script>
	import { SORT_TYPE } from '@/const/index.js'
	export default {
		props: { value: String, name: String, },
		data() { return { SORT_TYPE } },
		methods: {
			change() {
				var val;
				if (SORT_TYPE.NOT == this.value) val = SORT_TYPE.DESC;
				else if (SORT_TYPE.DESC == this.value) val = SORT_TYPE.ASC;
				else val = SORT_TYPE.NOT;
				this.$emit("input", val);
			}
		}
	}
</script>

<style
	lang="scss"
	scoped
>
	.searchResultsMall_fd1_0_c0_c0_c1_c1_c0 {
		width: 10rpx;
		height: 6rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 0rpx 6rpx 0rpx;
	}

	.searchResultsMall_fd1_0_c0_c0_c1_c1_c1 {
		width: 10rpx;
		height: 6rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.searchResultsMall_fd1_0_c0_c0_c1_c0 {
		margin: 0rpx 6rpx 0rpx 0rpx;
	}
</style>